import React from 'react'

class Child extends React.Component{
    // constructor(props){
    //    super(props)
    // }

    componentWillMount(){
        console.log('will mount')
    }

    componentDidMount(){
        console.log('did mount')
    }

    componentWillReceiveProps(newProps){
        console.log('will props'+newProps.count)
    }
    shouldComponentUpdate(){
        console.log('shoud update')
        return true
    }

    componentWillUnmount(){
        console.log('will update')
    }

    componentDidUpdate(){
        console.log('did update')
    }

    render(){
        return <div>
            <p>子组件</p>
            <p>{this.props.count}</p>
        </div>
    }
}

export default Child